import request from '@/utils/request';

// 查询销售出库列表
export function listProductOutSale(query) {
    return request({
        url: '/system/productOutSale/list',
        method: 'get',
        params: query
    })
}

// 查询销售出库详细信息
export function detailProductOutSale(id) {
    return request({
        url: '/system/productOutSale/getInfo?id=' + id,
        method: 'get'
    })
}

// 新销售出库列表
export function listOutSale(query) {
    return request({
        url: '/system/productOutOrder/list',
        method: 'get',
        params: query
    })
}

// 查询销售出库详细信息
export function detailOutSale(id) {
    return request({
        url: '/system/productOutOrder/getInfo?id=' + id,
        method: 'get'
    })
}

// 确定出库
export function confirmOutSale(data) {
    return request({
        url: '/system/productOutOrder/confirm',
        method: 'post',
        data: data
    })
}

// 拆单
export function splitOrderOutSale(data) {
    return request({
        url: '/system/productOutOrder/splitOrder',
        method: 'post',
        data: data
    })
}

// 扫码出库
export function outOfStock(data) {
    return request({
        url: '/system/productOutOrder/outOfStock',
        method: 'post',
        data: data
    })
}

// 删除扫码
export function deleteScanCode(data) {
    return request({
        url: '/system/productOutOrder/deleteScanCode',
        method: 'post',
        data: data
    })
}

// 手动输入出库
export function editOutSale(data) {
    return request({
        url: '/system/productOutOrderDetail/edit',
        method: 'post',
        data: data
    })
}

// 销售出库多仓位列表
export function storageMorePosition(id) {
    return request({
        url: '/system/productOutOrder/getPosition?id=' + id,
        method: 'get',
    })
}

// 多仓位新建
export function storageAddPosition(data) {
    return request({
        url: '/system/productOutOrder/addPosition',
        method: 'post',
        data: data
    })
}

// 多仓位编辑
export function storageEditPosition(data) {
    return request({
        url: '/system/productOutOrder/editPosition',
        method: 'post',
        data: data
    })
}

// 多仓位编辑仓位
export function storageUpdatePosition(data) {
    return request({
        url: '/system/productOutOrder/updatePosition',
        method: 'post',
        data: data
    })
}

// 多仓位单个新建
export function storageMoreAdd(data) {
    return request({
        url: '/system/productMultiPosition/add',
        method: 'post',
        data: data
    })
}

// 多仓位删除
export function storageDeletePosition(data) {
    return request({
        url: '/system/productMultiPosition/removeOne',
        method: 'post',
        data: data
    })
}

// 删除单个多仓位
export function delMorePosition(id) {
    return request({
        url: '/system/productOutOrder/removePosition?id=' + id,
        method: 'post'
    })
}

// 提交审核
export function submitOutSale(data) {
    return request({
        url: '/system/productOutOrder/submit',
        method: 'post',
        data: data
    })
}

// 一键出库
export function oneOutbound(id) {
    return request({
        url: '/system/dealerBinding/outbound?productOutOrderId=' + id,
        method: 'get'
    })
}

// 根据批次一键出库
export function batchOutbound(data) {
    return request({
        url: '/system/productOutOrder/outOfStockByBatch',
        method: 'post',
        data: data
    })
}

// 根据批次查询库存
export function batchDetail(data) {
    return request({
        url: '/system/productOutOrder/selectByBatchNumber',
        method: 'get',
        params: data
    })
}
